<?php

require_once 'common/conn.php';
if (isset($_GET['start'])) {
    $num = $_GET['start'];
} else {
    $num = 0;
}
if (isset($_GET['limit'])) {
    $count = $_GET['limit'];
}

if (isset($_GET['type'])) {
    $type = $_GET['type'];
}

$data = array();
if (is_numeric($num) && is_numeric($count)) {
    $db = new DBC();
    $sql = "SELECT productid,flashcode,age,name,url,imageURL,version,size,type1,type2,type3,downloadtimes,description FROM t_product WHERE status = 1 AND type1 = " . $type . " LIMIT " . $num . "," . $count;
    $temp = $db->fetchData($sql);
    if ($temp != false) {
        foreach ($data as $row) {
            $row['onlineprice'] = 20;
            $row['downloadprice'] = 200;
            array_push($data, $row);
        }
    }
}
echo json_encode($data);
?>